from django.conf.urls import url
from django.contrib import admin
from . import views

urlpatterns = [
    url(r'^register/$', views.UserRegiserView.as_view()),
    url(r'^usernames/(?P<username>\w{5,20})/count/$', views.CheckUsernameView.as_view()),
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$',views.CheckPhoneView.as_view()),
    url(r'^login/$',views.UserLoginView.as_view()),
    url(r'^logout/$',views.UserLogoutView.as_view()),
    url(r'^info/$',views.UserCenterInfoView.as_view()),
    url(r'^emails/$',views.EmailView.as_view()),
    url(r'^emails/verification/$',views.EmailView.as_view()),
    url(r'^addresses/$',views.UserAddressView.as_view()),
    url(r'^addresses/create/$',views.UserAddressCreateView.as_view()),#新增地址路由
    url(r'^addresses/(?P<address_id>\d+)/$',views.UserAddressUpdateView.as_view()),#地址修改路由
    url(r'^addresses/(?P<address_id>\d+)/default/$',views.UserAddressDefaultView.as_view()),#默认地址路由
    url(r'^addresses/(?P<address_id>\d+)/title/$',views.UserAddressTitleView.as_view()),
    url(r'^password/$', views.UserRepasswordView.as_view()),
    url(r'^find/$', views.FindPassword.as_view()),#获取找回密码页面
    url(r'^accounts/(?P<username>\w+)/sms/token/$', views.FindPasswordStp1.as_view()),#获取密码第一步
    url(r'^sms_codes/$', views.SmsPush.as_view()),#发送修改密码的短信验证码
    url(r'^accounts/(?P<username>\w+)/password/token/$', views.SmsCheck.as_view()),#校验手机号，验证码
    url(r'^users/(?P<user_id>\d+)/password/$', views.PasswordReset.as_view()),#重置密码






    ]